home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 23
/
q23.d81
/
t.sfx demo
< prev
next >
Wrap
Text File
|
2022-08-28
|
3KB
|
82 lines
S F X P L A Y E R
by Reiner Richter
Reiner Richter, a super programmer from Downunder, has been making a
name for himself on LOADSTAR 64 lately. On LS #120 (the gala 10th
Anniversary Issue) we published his SFX GENERATOR, a utility that allows you
to make incredible sound effects and save them in a file with a player, then
add the player to your BASIC or ML programs for easy sound effects. The
best thing is that he made his player work in both the C-64 and the C-128
modes!
Check out AULD LANG SYNE for the sounds. Would you believe that it
took about 10 minutes for me to add sounds to that program? I had to do no
POKEing to the SID chip. I simply Bloaded the player and sound effects
file, initialized the interrupt routine, then played the sounds with one
SYS.
I've placed some player/sfx files on this disk that have twenty wild
sounds. They're assembled at several places between $1300 and $4000 so you
shouldn't have any problem finding one that doesn't interfere with other ML
routines you use. If you want to use sound effects with CONTROL80-C (as I
did in AULD LANG SYNE) you should use the one assembled at $2300, which is
right at the end of CONTROL80-C's code.
Here, in a nutshell, is how to use "sfx player xxxx" in your program:
(1) BLOAD the player.
10 dv=peek(186):ifdv<8thendv=8
20 bload"sfx player 1300",u(dv),p4864
(2) Enable the player.
30 ad=4864:sysad:sysad+12
(3) Play one of the sounds:
200 sysad+6,x [where x is any number between 0 and 255]
(4) When quitting your program, you should disable the player.
9000 sysad+15
That's all there is to it.
I've placed a little demo on this disk which will allow you to hear the
sounds in "sfx player 1300". It's mainly the five lines above with a
minimum of embellishments. At least it returns to LOADSTAR 128 sooner or
later.
The second parameter in the play command can be any number between 0
and 255, but you only have as many sounds as were saved with the SFX
GENERATOR. With "sfx player 1300" you can use any number between 0 and 19.
With "als sfx" it's any number between 0 and 5.
NOTE: Since the player sees each sound as numbers between 0 and 255, and
that's what every memory location in your computer has in it anyway, if you
sysad+6,38 and the player you loaded has only 20 sounds, you'll simply get a
random sound. In the demo, once you get past 20 you're hearing random
sounds, some of which might sound pretty good!
One word of warning: when you are programming with interrupt-driven
routines (such as this player) it's a good idea to disable the interrupt as
soon as you break out of the program to edit the code. Who knows where in
the interrupt cycle it is? I had the program lock up a couple of times when
I re-ran it. Just enter SYSAD+15 right after hitting STOP/RESTORE and all
will be well.
I cannot recommend Reiner's SFX GENERATOR too highly. I plan to use it
in many of my future C-128 programs. If you don't subscribe to LOADSTAR 64
you can get issue #120 by calling 1-800-594-3370 and asking for it as a back
issue. I'm hoping that more programmers take a hint from Reiner and make
their ML routines work in both the 64 and the 128 modes.
FT
\\\\\ R - Run RETURN - Menu \\\\\